/*    
    OpenMheg - A free MHEG-5 library
    Copyright (C) 2008 Dharmesh Malam

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Text;

namespace Core.Model
{
    public class MHEGTimer
    {
        private int fireTime;

        public int FireTime
        {
            get { return fireTime; }
            set { fireTime = value; }
        }
        private int id;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        private Group group;

        public Group Group
        {
            get { return group; }
            set { group = value; }
        }

        private bool absolute;

        public bool Absolute
        {
            get { return absolute; }
            set { absolute = value; }
        }

        private int timerHash;

        public int TimerHash
        {
            get { return timerHash; }
            set { timerHash = value; }
        }

        public MHEGTimer ( int id, int fireTime, bool absolute , Group group )
        {
            this.Id = id;
            this.FireTime = fireTime;
            this.Absolute = absolute;
            this.Group = group;
        }

        public override bool Equals ( Object o )
        {
            if ( this == o ) return true;
            if ( !( o is MHEGTimer ) ) return false;

            //const 
            MHEGTimer mhegTimer = ( MHEGTimer ) o;

            return ( GetHashCode() == mhegTimer.GetHashCode() );
        }

        public override int GetHashCode ()
        {
            return id;
        }

        public override string ToString ()
        {
            return "MHEGTimer "+id.ToString() +":"+fireTime.ToString()+"ms on "+Group.ToString();
        }
    }
}
